<?php
include ('top.ajax.php');

$nav = Navigation::getInstance();
$slug=$nav->getRewrite(utf8_decode($_POST['tag']));
$nom=utf8_decode($_POST['tag']);
if(!(ProductTag::existProductTag($slug))){

$tag=new ProductTag();
$tag['nom']=$nom;
$tag['slug']=$slug;
$tag->save();
$tag->load();
}
else{
$tag=ProductTag::get($slug);
}

$_SESSION['tags'][]=$tag;

?>